package pl.prac06;
// $ANTLR 3.4 Anasint2.g 2012-10-31 18:21:57

import org.antlr.runtime.*;
import java.util.Stack;
import java.util.List;
import java.util.ArrayList;
import java.util.Map;
import java.util.HashMap;

@SuppressWarnings({"all", "warnings", "unchecked"})
public class Anasint2 extends Parser {
    public static final String[] tokenNames = new String[] {
        "<invalid>", "<EOR>", "<DOWN>", "<UP>", "NUMERO", "OPERADOR1", "OPERADOR2", "PARENTESIS", "SEPARADOR"
    };

    public static final int EOF=-1;
    public static final int NUMERO=4;
    public static final int OPERADOR1=5;
    public static final int OPERADOR2=6;
    public static final int PARENTESIS=7;
    public static final int SEPARADOR=8;

    // delegates
    public Parser[] getDelegates() {
        return new Parser[] {};
    }

    // delegators


    public Anasint2(TokenStream input) {
        this(input, new RecognizerSharedState());
    }
    public Anasint2(TokenStream input, RecognizerSharedState state) {
        super(input, state);
    }

    public String[] getTokenNames() { return Anasint2.tokenNames; }
    public String getGrammarFileName() { return "Anasint2.g"; }



    // $ANTLR start "entrada"
    // Anasint2.g:12:1: entrada : instrucciones EOF ;
    public final void entrada() throws RecognitionException {
        try {
            // Anasint2.g:12:9: ( instrucciones EOF )
            // Anasint2.g:12:11: instrucciones EOF
            {
            pushFollow(FOLLOW_instrucciones_in_entrada31);
            instrucciones();

            state._fsp--;
            if (state.failed) return ;

            match(input,EOF,FOLLOW_EOF_in_entrada33); if (state.failed) return ;

            }

        }

        	catch (RecognitionException ae) {
        		throw ae;
        	}

        finally {
        	// do for sure before leaving
        }
        return ;
    }
    // $ANTLR end "entrada"



    // $ANTLR start "instrucciones"
    // Anasint2.g:13:1: instrucciones : ( instruccion )* ;
    public final void instrucciones() throws RecognitionException {
        try {
            // Anasint2.g:13:15: ( ( instruccion )* )
            // Anasint2.g:13:17: ( instruccion )*
            {
            // Anasint2.g:13:17: ( instruccion )*
            loop1:
            do {
                int alt1=2;
                int LA1_0 = input.LA(1);

                if ( (LA1_0==NUMERO||LA1_0==PARENTESIS) ) {
                    alt1=1;
                }


                switch (alt1) {
            	case 1 :
            	    // Anasint2.g:13:18: instruccion
            	    {
            	    pushFollow(FOLLOW_instruccion_in_instrucciones42);
            	    instruccion();

            	    state._fsp--;
            	    if (state.failed) return ;

            	    }
            	    break;

            	default :
            	    break loop1;
                }
            } while (true);


            }

        }

        	catch (RecognitionException ae) {
        		throw ae;
        	}

        finally {
        	// do for sure before leaving
        }
        return ;
    }
    // $ANTLR end "instrucciones"



    // $ANTLR start "instruccion"
    // Anasint2.g:14:1: instruccion : exp SEPARADOR ;
    public final void instruccion() throws RecognitionException {
        try {
            // Anasint2.g:14:13: ( exp SEPARADOR )
            // Anasint2.g:14:15: exp SEPARADOR
            {
            pushFollow(FOLLOW_exp_in_instruccion52);
            exp();

            state._fsp--;
            if (state.failed) return ;

            match(input,SEPARADOR,FOLLOW_SEPARADOR_in_instruccion54); if (state.failed) return ;

            }

        }

        	catch (RecognitionException ae) {
        		throw ae;
        	}

        finally {
        	// do for sure before leaving
        }
        return ;
    }
    // $ANTLR end "instruccion"



    // $ANTLR start "exp"
    // Anasint2.g:15:1: exp : exp_mult ( OPERADOR1 exp_mult )* ;
    public final void exp() throws RecognitionException {
        try {
            // Anasint2.g:15:5: ( exp_mult ( OPERADOR1 exp_mult )* )
            // Anasint2.g:15:7: exp_mult ( OPERADOR1 exp_mult )*
            {
            pushFollow(FOLLOW_exp_mult_in_exp62);
            exp_mult();

            state._fsp--;
            if (state.failed) return ;

            // Anasint2.g:15:16: ( OPERADOR1 exp_mult )*
            loop2:
            do {
                int alt2=2;
                int LA2_0 = input.LA(1);

                if ( (LA2_0==OPERADOR1) ) {
                    alt2=1;
                }


                switch (alt2) {
            	case 1 :
            	    // Anasint2.g:15:17: OPERADOR1 exp_mult
            	    {
            	    match(input,OPERADOR1,FOLLOW_OPERADOR1_in_exp65); if (state.failed) return ;

            	    pushFollow(FOLLOW_exp_mult_in_exp67);
            	    exp_mult();

            	    state._fsp--;
            	    if (state.failed) return ;

            	    }
            	    break;

            	default :
            	    break loop2;
                }
            } while (true);


            }

        }

        	catch (RecognitionException ae) {
        		throw ae;
        	}

        finally {
        	// do for sure before leaving
        }
        return ;
    }
    // $ANTLR end "exp"



    // $ANTLR start "exp_mult"
    // Anasint2.g:16:1: exp_mult : exp_base ( OPERADOR2 exp_base )* ;
    public final void exp_mult() throws RecognitionException {
        try {
            // Anasint2.g:16:10: ( exp_base ( OPERADOR2 exp_base )* )
            // Anasint2.g:16:12: exp_base ( OPERADOR2 exp_base )*
            {
            pushFollow(FOLLOW_exp_base_in_exp_mult77);
            exp_base();

            state._fsp--;
            if (state.failed) return ;

            // Anasint2.g:16:21: ( OPERADOR2 exp_base )*
            loop3:
            do {
                int alt3=2;
                int LA3_0 = input.LA(1);

                if ( (LA3_0==OPERADOR2) ) {
                    alt3=1;
                }


                switch (alt3) {
            	case 1 :
            	    // Anasint2.g:16:22: OPERADOR2 exp_base
            	    {
            	    match(input,OPERADOR2,FOLLOW_OPERADOR2_in_exp_mult80); if (state.failed) return ;

            	    pushFollow(FOLLOW_exp_base_in_exp_mult82);
            	    exp_base();

            	    state._fsp--;
            	    if (state.failed) return ;

            	    }
            	    break;

            	default :
            	    break loop3;
                }
            } while (true);


            }

        }

        	catch (RecognitionException ae) {
        		throw ae;
        	}

        finally {
        	// do for sure before leaving
        }
        return ;
    }
    // $ANTLR end "exp_mult"



    // $ANTLR start "exp_base"
    // Anasint2.g:17:1: exp_base : ( NUMERO | PARENTESIS exp PARENTESIS );
    public final void exp_base() throws RecognitionException {
        try {
            // Anasint2.g:17:10: ( NUMERO | PARENTESIS exp PARENTESIS )
            int alt4=2;
            int LA4_0 = input.LA(1);

            if ( (LA4_0==NUMERO) ) {
                alt4=1;
            }
            else if ( (LA4_0==PARENTESIS) ) {
                alt4=2;
            }
            else {
                if (state.backtracking>0) {state.failed=true; return ;}
                NoViableAltException nvae =
                    new NoViableAltException("", 4, 0, input);

                throw nvae;

            }
            switch (alt4) {
                case 1 :
                    // Anasint2.g:17:12: NUMERO
                    {
                    match(input,NUMERO,FOLLOW_NUMERO_in_exp_base92); if (state.failed) return ;

                    }
                    break;
                case 2 :
                    // Anasint2.g:18:3: PARENTESIS exp PARENTESIS
                    {
                    match(input,PARENTESIS,FOLLOW_PARENTESIS_in_exp_base96); if (state.failed) return ;

                    pushFollow(FOLLOW_exp_in_exp_base98);
                    exp();

                    state._fsp--;
                    if (state.failed) return ;

                    match(input,PARENTESIS,FOLLOW_PARENTESIS_in_exp_base100); if (state.failed) return ;

                    }
                    break;

            }
        }

        	catch (RecognitionException ae) {
        		throw ae;
        	}

        finally {
        	// do for sure before leaving
        }
        return ;
    }
    // $ANTLR end "exp_base"

    // Delegated rules


 

    public static final BitSet FOLLOW_instrucciones_in_entrada31 = new BitSet(new long[]{0x0000000000000000L});
    public static final BitSet FOLLOW_EOF_in_entrada33 = new BitSet(new long[]{0x0000000000000002L});
    public static final BitSet FOLLOW_instruccion_in_instrucciones42 = new BitSet(new long[]{0x0000000000000092L});
    public static final BitSet FOLLOW_exp_in_instruccion52 = new BitSet(new long[]{0x0000000000000100L});
    public static final BitSet FOLLOW_SEPARADOR_in_instruccion54 = new BitSet(new long[]{0x0000000000000002L});
    public static final BitSet FOLLOW_exp_mult_in_exp62 = new BitSet(new long[]{0x0000000000000022L});
    public static final BitSet FOLLOW_OPERADOR1_in_exp65 = new BitSet(new long[]{0x0000000000000090L});
    public static final BitSet FOLLOW_exp_mult_in_exp67 = new BitSet(new long[]{0x0000000000000022L});
    public static final BitSet FOLLOW_exp_base_in_exp_mult77 = new BitSet(new long[]{0x0000000000000042L});
    public static final BitSet FOLLOW_OPERADOR2_in_exp_mult80 = new BitSet(new long[]{0x0000000000000090L});
    public static final BitSet FOLLOW_exp_base_in_exp_mult82 = new BitSet(new long[]{0x0000000000000042L});
    public static final BitSet FOLLOW_NUMERO_in_exp_base92 = new BitSet(new long[]{0x0000000000000002L});
    public static final BitSet FOLLOW_PARENTESIS_in_exp_base96 = new BitSet(new long[]{0x0000000000000090L});
    public static final BitSet FOLLOW_exp_in_exp_base98 = new BitSet(new long[]{0x0000000000000080L});
    public static final BitSet FOLLOW_PARENTESIS_in_exp_base100 = new BitSet(new long[]{0x0000000000000002L});

}